//package com.wp.controller;
//
//import com.wp.entity.User;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.ui.Model;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//
//import javax.servlet.http.HttpSession;
//import java.util.List;
//
//@Controller
//public class UserController {
//
////    @Autowired
////    private UserService userService;
//
////    @RequestMapping("/hello")
////    public String hello(Model model){
////
////        model.addAttribute("name","helloSpring boot");
////
////        return "text";
////    }
//
////    @GetMapping("/toLogin")
////    public String loginTo(){
////
////        return "login";
////    }
//
//    @PostMapping("/login")
//    public String Login(String usrName, String usrPassword,HttpSession session,Model model){
//
////        User user = userService.login(usrName,usrPassword);
//
////        if (user!=null){
////            // 存储到session中
////            session.setAttribute("loginUser",user);
//////          String username = (String) session.getAttribute("loginUser");
////            return "redirect:/add";
////        }else {
////            return "login";
////        }
//    }
//
//    @GetMapping("/add")
//    public String findAll(Model model){
////        List<User> list = userService.findAll();
//
//        model.addAttribute("user",list);
//
//        return "text";
//    }
//}
